package com.qezhhnjy.cloud.rabbitmq.demo;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author zhaoyangfu - 2020/7/31 15:18
 */
@Component
public class Consumer {

    @RabbitHandler
    @RabbitListener(queuesToDeclare = @Queue("rabbitmq_queue"))
    public void process(String msg) {
        System.out.println("消费者消费消息=>" + msg);
    }
}
